package com.zhijian.medical.service;


import com.zhijian.medical.entity.po.AssessmentPaper;
import com.zhijian.medical.entity.vo.request.AssessmentPaperDoScoreVo;
import com.zhijian.medical.entity.vo.request.AssessmentPaperPersonSearchVo;
import com.zhijian.medical.entity.vo.request.AssessmentPaperSearchVo;
import com.zhijian.medical.entity.vo.request.AssessmentStartVo;
import com.zhijian.medical.entity.vo.response.AssessmentAnswerOfDigitalSliceCaseVo;
import com.zhijian.medical.entity.vo.response.AssessmentWebDetailVo;
import com.zhijian.medical.entity.vo.response.AssessmentDoingVo;
import com.zhijian.medical.entity.vo.response.AssessmentPaperVo;
import com.zhijian.medical.util.Page;

import java.util.List;

/**
 * 考核-试卷模块 业务处理层
 *
 * @author HCG
 * @version 1.0
 * @date 2023-02-01 10:34:52
 */
public interface AssessmentPaperService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    AssessmentPaper selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    AssessmentPaperVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 根据考核id进行删除
     *
     * @param assessmentId
     */
    void deleteByAssessmentId(Long assessmentId);

    /**
     * 新增
     *
     * @param assessmentPaper
     * @return
     */
    Long insert(AssessmentPaper assessmentPaper);

    /**
     * 更改
     *
     * @param assessmentPaper
     * @return
     */
    boolean update(AssessmentPaper assessmentPaper);

    /**
     * 动态修改
     *
     * @param record
     * @return
     */
    boolean updateByPrimaryKeySelective(AssessmentPaper record);

    /**
     * 总数
     *
     * @param assessmentPaperSearchVo
     * @return
     */
    Integer count(AssessmentPaperSearchVo assessmentPaperSearchVo);

    /**
     * 列表
     *
     * @param assessmentPaperSearchVo
     * @return
     */
    List<AssessmentPaperVo> selectList(AssessmentPaperSearchVo assessmentPaperSearchVo);

    /**
     * 分页查询
     *
     * @param assessmentPaperSearchVo
     * @return
     */
    Page<AssessmentPaperVo> selectPage(AssessmentPaperSearchVo assessmentPaperSearchVo);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities 实例对象列表
     * @return 影响行数
     */
    boolean insertBatch(List<AssessmentPaper> entities);

    /**
     * 根据人员id与考核id进行查找
     *
     * @param userId
     * @param assessmentId
     * @return
     */
    AssessmentPaper selectByUserIdAndAssessmentId(Long userId, Long assessmentId);

    /**
     * 生成试卷
     *
     * @param assessmentStartVo
     * @return
     */
    Long generate(AssessmentStartVo assessmentStartVo);

    /**
     * 详情，用作考试的时候显示
     *
     * @param assessmentId
     * @param userId
     * @return
     */
    AssessmentDoingVo singleDetail(Long assessmentId, Long userId);

    /**
     * 考核的主详情
     *
     * @param assessmentPaperPersonSearchVo
     * @return
     */
    AssessmentWebDetailVo mainDetail(AssessmentPaperPersonSearchVo assessmentPaperPersonSearchVo);

    /**
     * 阅卷人进行打分
     *
     * @param assessmentPaperDoScoreVo
     * @return
     */
    boolean score(AssessmentPaperDoScoreVo assessmentPaperDoScoreVo);

    /**
     * 根据考核id与做卷人id查询出此做卷人，填写的数字切片部分的答案
     *
     * @param assessmentId
     * @param doUserId
     * @return
     */
    List<AssessmentAnswerOfDigitalSliceCaseVo> selectAssessmentAnswerOfDigitalSliceCaseListByCondition(Long assessmentId, Long doUserId);

    /**
     * 查询某次考核，合格的人员的总数
     *
     * @param assessmentId
     * @return
     */
    Integer countUpByAssessmentId(Long assessmentId);

}